<template>
	<view class="integral-rules-wrapper">
		<view class="list">1.积分有有效期：永久有效</view>
		<view class="list">2.下单返积分：单笔订单每支付 1 元，奖励 1 积分</view>
		<view class="list">3.积分抵现：{{ integralRulesInfo.consumeIntegral}} 积分 = {{ integralRulesInfo.cashOffset}} 元</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				integralRulesInfo: {},
			}
		},
		methods: {
			//获取积分规则
			async getRules() {
				try {
					const res = await this.$request({
						methods: 'GET',
						url: '/marketing-center/integralRule/queryAvailableConsumeRule',
					})
					this.integralRulesInfo = res.datas
					uni.hideLoading()
				} catch (e) {
					uni.hideLoading()
					uni.showToast({
						title: '请求失败',
						icon: 'error'
					})
				}
			},
		},
		onLoad(option) {
			// this.paddingTop = this.$store.getters['global/getSystemInfo'].navBarHeight
			uni.showLoading({
				title: '加载中...'
			})
			this.getRules()
		},

	}
</script>

<style lang="scss" scoped>
	.integral-rules-wrapper {
		padding: 36rpx;
		height: calc(100vh - 72rpx);
		background: #fff;

		.list {
			padding-bottom: 36rpx;
		}
	}
</style>
